package com.creative.accountsdk.net.account;

import com.creative.accountsdk.net.Protocol;
import com.creative.accountsdk.net.XParams;
import com.loopj.android.http.RequestParams;

import org.json.JSONObject;

/**
 * 合并第三方平台账号
 * Created by yinjialiang on 15-6-23.
 */
public class ThirdMergeProtocol extends Protocol{
    private int platform;
    private String puid;
    private String ptoken;
    private String nickname;

    public JSONObject jsonUser;

    public ThirdMergeProtocol(int platform, String puid, String ptoken, String nickname)
    {
        this.platform = platform;
        this.puid = puid;
        this.ptoken = ptoken;
        this.nickname = nickname;
    }

    @Override
    public RequestParams getParams() {
        return new XParams().put("plat", platform)
                .put("puid", puid)
                .put("ptoken", ptoken)
                .put("pnickname", nickname).getParams();
    }

    @Override
    public String getUrl() {
        return getUrlPrefix()+"tpacct/merge";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {
        this.jsonUser = returnMap;
    }
}
